{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([0.067732, 0.42781 , 0.995731, 0.738336, 0.981083]),\n",
       " array([3.176513, 3.816464, 4.550095, 4.256571, 4.560815]))"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "\n",
    "#加载数据\n",
    "def load_data():\n",
    "    with open('简单线性数据.txt') as fr:\n",
    "        lines = fr.readlines()\n",
    "\n",
    "    x = np.empty((len(lines)), dtype=float)\n",
    "    y = np.empty(len(lines), dtype=float)\n",
    "\n",
    "    for i in range(len(lines)):\n",
    "        line = lines[i].strip().split('\\t')\n",
    "        x[i] = line[0]\n",
    "        y[i] = line[1]\n",
    "\n",
    "    return x, y\n",
    "\n",
    "\n",
    "x, y = load_data()\n",
    "x[:5], y[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "#常量\n",
    "N = len(x)\n",
    "w = 2.0\n",
    "b = 2.0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3de5RU1Zn+8e/bTaGNqE0EozQimhhMDApKAMdcvI3ES5SgRsdbYlwSHX8TNUqCE0chMYpDYpiEKMMYMzo4xhvpkYhBDRAVgwo2FxHJkDiojVFUGgO00Jf9++NU0VXVdTnVXVWnzqnnsxbLZtfpqn2W+vTu9+yLOecQEZHwqwm6AyIiUhwKdBGRiFCgi4hEhAJdRCQiF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V8fsO/Z5QZnaPmb1rZq9keb24ueacC/wPUAv8GTgU6AusAj6Tds1pwBN4+8qMA14Iut9luu+/AwbEvz41Cvft996TrluEtwHcOUH3u0z/zuvxTgQbGv/7/kH3u0z3/c/A7fGvBwEfAH2D7nsv7/uLwNHAK1leL2quVcoIfQywwTn3F+fcLuDXeMfaJdt9zJ1zbhlQb2YHlrujRZb3vp1zzzvntsT/ugxvr/ko8PPvHOCf8Pbif7ecnSshP/d9ATDPOfcGgHMuCvfu574dsHd8y+7+eIHeXt5uFpdz7hm8+8imqLlWKYHu5wg7X8fchUyh93QZ3k/zKMh772bWAHwVmF3GfpWan3/nnwIGmNkSM1thZpeUrXel4+e+ZwGfxjscZw1wtXOuszzdC0xRc83Pfujl4OcIO1/H3IWM73sysxPwAv3zJe1R+fi595nA95xzHd6gLRL83Hcf4BjgJKAO+KOZLXPO/anUnSshP/c9HlgJnAh8AnjKzJ513Y+8jJKi5lqlBLqfI+yieMydr3sysyOBu4FTnXPvl6lvpebn3kcDv46H+UDgNDNrd841lqeLJeH3v/X3nHPbge1m9gxwFBDmQPdz35cC051XXN5gZq8DhwMvlqeLgShqrlVKyeUl4DAzO8TM+gLn4x1rlyyKx9zlvW8zGwrMAy4O+QgtXd57d84d4pwb5pwbBjwC/GPIwxz8/bf+P8AXzKyPmfUDxgLrytzPYvNz32/g/VaCmX0cGA78pay9LL+i5lpFjNCdc+1m9v+AhXhPw+9xzq01syvir0fymDuf930TsB9wZ3yk2u4isDOdz3uPHD/37ZxbZ2a/A1YDncDdzrmM097Cwue/7x8C/2lma/BKEd9zzoV6W10zewA4HhhoZm8BNwMxKE2uaem/iEhEVErJRUREekmBLiISEQp0EZGIUKCLiESEAl1EJCIU6CIiEaFAFxGJiP8PGfBYbs2UwLwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "\n",
    "\n",
    "def draw():\n",
    "    Y = np.empty(len(x))\n",
    "    for i in range(len(x)):\n",
    "        Y[i] = w * x[i] + b\n",
    "\n",
    "    plt.scatter(x, y)\n",
    "    plt.plot(x, Y, c='red')\n",
    "\n",
    "    plt.show()\n",
    "\n",
    "\n",
    "draw()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(2.135464, 3.176513)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#预测函数\n",
    "def predict(x):\n",
    "    return w * x + b\n",
    "\n",
    "\n",
    "predict(x[0]), y[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "150.50416404192197"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#求loss,就是简单的做差求平方和\n",
    "def get_loss():\n",
    "    loss = 0\n",
    "    for i in range(N):\n",
    "        loss += np.power(predict(x[i]) - y[i], 2)\n",
    "    return loss\n",
    "\n",
    "\n",
    "get_loss()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(-157.37314896242987, -343.58540000000016)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#求w梯度\n",
    "#为了简化,这里假设只有两个样本\n",
    "#loss = (w*x1 + b - y1)^2 + (w*x2 + b - y2)^2\n",
    "#定义z1 = b - y1\n",
    "#定义z2 = b - y2\n",
    "#带入得\n",
    "#loss = (w * x1 + z1)^2 + (w*x2 + z2)^2\n",
    "#平方和公式\n",
    "#loss = w^2*x1^2 + z1^2 + 2*w*z1*x1 + w^2*x2^2 + z2^2 + 2*w*x2*z2\n",
    "#提取公因数\n",
    "#loss = w^2*(x1^2 + x2^2) + 2*w*(z1*x1 + z2*x2) + z1^2 + z2^2\n",
    "#求导数\n",
    "#d_loss/d_w = 2*w*(x1^2 + x2^2) + 2*(z1*x1 + z2*x2)\n",
    "#定义A = 2*w*(x1^2 + x2^2)\n",
    "#带回z1和z2\n",
    "#d_loss/d_w = A + 2*[(b - y1)*x1 + (b - y2)*x2]\n",
    "#分配率,并调整顺序\n",
    "#d_loss/d_w = A - 2*y1*x1 - 2*y2*x2 + 2*b*x1 + 2*b*x2\n",
    "#加括号\n",
    "#d_loss/d_w = A - {2*y1*x1 + 2*y2*x2 - 2*b*x1 - 2*b*x2}\n",
    "#提取公因数\n",
    "#d_loss/d_w = A - {2*[(y1 - b)*x1 + (y2 - b)*x2]}\n",
    "#带回A\n",
    "#d_loss/d_w = 2*w*(x1^2 + x2^2) - {2*[(y1 - b)*x1 + (y2 - b)*x2]}\n",
    "#提取公因数\n",
    "#d_loss/d_w = 2*{w*(x1^2 + x2^2) - [(y1 - b)*x1 + (y2 - b)*x2]}\n",
    "#整理成一般形式,这就是书上的公式了.\n",
    "#d_loss/d_w = 2*{w*[sigma(xi^2)] - [sigma((yi - b)*xi)]}\n",
    "\n",
    "\n",
    "#求b梯度\n",
    "#为了简化,这里假设只有两个样本\n",
    "#loss = (w*x1 - y1 + b)^2 + (w*x2 - y2 + b)^2\n",
    "#定义z1 = w*x1 - y1\n",
    "#定义z2 = w*x2 - y2\n",
    "#带入得\n",
    "#loss = (z1 + b)^2 + (z2 + b)^2\n",
    "#平方和公式\n",
    "#loss = z1^2 + b^2 + 2*z1*b + z2^2 + b^2 + 2*z2*b\n",
    "#求导数\n",
    "#d_loss/d_b = 2*b + 2*z1 + 2*b + 2*z2\n",
    "#提取公因数\n",
    "#d_loss/d_b = 2*[b + b + z1 + z2]\n",
    "#带回z1和z2\n",
    "#d_loss/d_b = 2*[b + b + w*x1 - y1 + w*x2 - y2]\n",
    "#调整顺序\n",
    "#d_loss/d_b = 2*[b + b - y1 + w*x1 - y2 + w*x2]\n",
    "#加括号\n",
    "#d_loss/d_b = 2*[b + b - (y1 - w*x1 + y2 - w*x2)]\n",
    "#整理成一般形式,这就是书上的公式了.\n",
    "#d_loss/d_b = 2*[N*b - sigma(yi - w*xi)]\n",
    "def get_gradient():\n",
    "\n",
    "    #d_loss/d_w = 2*{w*[sigma(xi^2)] - [sigma((yi - b)*xi)]}\n",
    "    sigma1 = 0\n",
    "    sigma2 = 0\n",
    "    for i in range(N):\n",
    "        sigma1 += np.power(x[i], 2)\n",
    "        sigma2 += (y[i] - b) * x[i]\n",
    "    _w = 2 * (w * sigma1 - sigma2)\n",
    "\n",
    "    #d_loss/d_b = 2*[N*b - sigma(yi - w*xi)]\n",
    "    sigma3 = 0\n",
    "    for i in range(N):\n",
    "        sigma3 += y[i] - w * x[i]\n",
    "    _b = 2 * (N * b - sigma3)\n",
    "\n",
    "    return _w, _b\n",
    "\n",
    "\n",
    "get_gradient()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "54.658990441682484\n",
      "3.2555823305077998\n",
      "3.1314882899961223\n",
      "3.016683995019165\n",
      "2.9092999179300887\n",
      "2.808856431724879\n",
      "2.7149049428763417\n",
      "2.627025851953277\n",
      "2.544826679634529\n",
      "2.4679403138458404\n",
      "2.3960233701901608\n",
      "2.3287546583487226\n",
      "2.2658337476038017\n",
      "2.2069796250764897\n",
      "2.1519294406870477\n",
      "2.1004373332326356\n",
      "2.0522733323395586\n",
      "2.007222331386031\n",
      "1.9650831268083038\n",
      "1.9256675194997124\n",
      "1.8887994742892398\n",
      "1.8543143337457995\n",
      "1.8220580827970052\n",
      "1.7918866608780164\n",
      "1.76366531853855\n",
      "1.7372680156345102\n",
      "1.712576858416469\n",
      "1.6894815730010575\n",
      "1.6678790128735987\n",
      "1.6476726982225085\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgA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ce1N4WOZ9mltMr2mi3G+/Vu7Oq9bRPKBs4BZTTiuxublv/d3gS4islhElonIBU02usbj5brvBr4HbAZWAleqak3TDK9ZZS2uedkcvLmJy7HkmlAvfVobz9ckIoNxAv3xjTqipuHluu8ArlXVameSlxO8XHc74Bjg/4AA8JaILFHVjxp7cI3Iy3UPBZYDQ4BvA6+IyL9V9avGHlwzy1pcaw2BfhNwcFy7AOebPdM+rY2naxKRo4AHgNNV9csmGltj8nLdhcCT4SB/ADBMRKpUtbhphtgovP47/0JVdwG7ROR1oC/QmgO9l+u+CJimTuJ6rYisA3oDbzfNEJtN1uJaa0jdvAMcJiK9RKQ9MBaYn9RnPnBB+C71ccAOVf2sqQeaZXVet4j0AOYCP23ls7p4dV63qvZS1Z6q2hN4FrislQd58Pbv/B/Aj0SknYh0AgYCq5t4nNnm5bo34PwWg4gcCBwOfNKko2weWYtrLX5Gr6pVInI5sBDnDv3fVHWViIwPn5+FU3kxDFgL7MaZAbRqHq/7emB/4K/h2W2VtvLV/jxed87xct2qulpEXgLeA2qAB1TVtTSvtfD43/tPwIMishInnXGtqrb65YtF5AngJOAAEdkETAb8kP24ZksgGGNMjmsNqRtjjDENYIHeGGNynAV6Y4zJcRbojTEmx1mgN8aYHGeB3hhjcpwFemOMyXH/H04Cdn9krV8mAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "(1.8222910484218504, 2.9452208364605506)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#慢慢调整w和b\n",
    "for i in range(300):\n",
    "    _w, _b = get_gradient()\n",
    "    w -= _w * 1e-4\n",
    "    b -= _b * 1e-3\n",
    "\n",
    "    if i % 10 == 0:\n",
    "        print(get_loss())\n",
    "\n",
    "draw()\n",
    "w, b"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
